Hidden file and hidden directory - Wikipedia#Unix_and_Unix-like_environments

Unix and Unix-like environments

The Unix -based ls shell command hides any file that starts with a dot (commonly called a dot file or dotfile) unless the option -a or -A is specified.1 Even with wildcard matching, the command does not match a dotfile unless the expression starts with . For example, ﹡f﹡ does not match .foo, but .f﹡ does.

According to Rob Pike, dotfiles were an unintended consequence of the implementation of the hierarchical file system during the Unix 2nd Edition re-write, which introduced . as a name in a directory that refers to the directory itself and .. as a name in a directory that refers to its parent directory. In order to exclude those two entries from ls output, all entries prefixed with . were omitted. This meant that any file or directory could be excluded from the output of ls by giving it a file name with . as the first character.2

Commonly, user-specific application configuration information is stored in the user’s home directory as a dotfile. Notable dotfiles include startup shell scripts such as .profile, .login, and .cshrc as well as .plan and .project which are used by the finger and name commands.3 Many applications, from bash to desktop environments such as GNOME, store user-specific configuration this way, but the XDG Base Directory Specification aims to migrate such config files to be non-hidden (not starting with .) but stored in a hidden directory $HOME/.config.4

Printed 2026-10-13.

(echo:: @ ᯤ)

Footnotes

  1. “ls(1) - Linux man page”. linux.die.net. Retrieved 2020-08-23. ↩

  2. Rob Pike (August 3, 2012). “A lesson in shortcuts”. Google Plus. Archived from the original on 2014-12-05. ↩

  3. One user could lookup another by using the command along with the username (and hostname if not on the local host), and the finger service would respond with the other user’s current status, and the contents of the .plan and .project files in that user’s $HOME folder. ↩

  4. Bastian, Waldo; Lortie, Ryan; Poettering, Lennart (November 24, 2010). “XDG Base Directory Specification”. Retrieved June 4, 2014. ↩